import Vue from 'vue'
import previewImg from "./index.vue";
const CreateLoading = Vue.extend(previewImg)
const instance = new CreateLoading({
    el: document.createElement('div')
})
const $previewImg =function(urlList){
    instance.showViewer = true;
    instance.urlList = [urlList];
}
export default {
    install() {
        //判断Vue里面是否存在Vue
        if (!Vue.$previewImg) {
            Vue.$previewImg = $previewImg
        }
        //往所有组件中混入$previewImg
        Vue.mixin({
            created(){
                this.$previewImg= Vue.$previewImg
            }
        })
 
    }
}